package com.woniuxy.mapper;

import com.woniuxy.entity.Camp;
import com.woniuxy.entity.CampExample;

import java.util.List;
import java.util.Map;

import com.woniuxy.vo.CampVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;


/*
@author Jan
@create 2020-05-20 19:00

*/

public interface CampMapper {
    long countByExample(CampExample example);

    int deleteByExample(CampExample example);

    int deleteByPrimaryKey(Integer campId);

    int insert(Camp record);

    int insertSelective(Camp record);

    List<Camp> selectByExample(CampExample example);

    Camp selectByPrimaryKey(Integer campId);

    int updateByExampleSelective(@Param("record") Camp record, @Param("example") CampExample example);

    int updateByExample(@Param("record") Camp record, @Param("example") CampExample example);

    int updateByPrimaryKeySelective(Camp record);

    int updateByPrimaryKey(Camp record);

    //条件查询
    List<CampVO> selectCampByExample(Map<String, Object> map);

    int selectCampIdBycampName(String campName);

    @Select("select camp_id id,campname text from camp left join city on camp.city_id = city.city_id where city_name = #{city}")
    List<Map<String, Object>> selectCampByCity(String city);

    List<CampVO> selectAllCampVO();
}